package com.papper.common.service.sys;

import com.papper.common.bean.sys.SysSystem;
import com.papper.common.mapper.sys.SysSystemMapper;
import com.papper.common.service.ServiceImpl;
import com.papper.common.config.LocalConfig;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

@Service("sysSystemService")
public class SysSystemService extends ServiceImpl<SysSystemMapper, SysSystem> {

	/**
	 * Find sys system sys system.
	 *
	 * @return the sys system
	 */
	public SysSystem findSysSystem() {
		return findWithCode(LocalConfig.I().GS(LocalConfig.SYSTEM_CODE));
	}

	/**
	 * Find with code sys system.
	 *
	 * @param systemCode the system code
	 * @return the sys system
	 */
	public SysSystem findWithCode(String systemCode) {
		Example example = new Example(SysSystem.class);
		example.createCriteria().andEqualTo("systemCode", systemCode);
		return findOne(example);
	}
}